package com.lixueju.security.box.core.exception;


import com.lixueju.security.box.core.dto.ResultData;
import com.lixueju.security.box.core.enums.ResultDataEnum;
import lombok.Data;

/**
 * @author lixueju
 * @since 2019/10/7 17:39
 **/
@Data
public class SecurityBoxException extends RuntimeException {

    //返回数据
    private ResultData resultData;

    // 系统异常
    private Exception exception;

    public SecurityBoxException(Exception exception) {
        this.exception = exception;
    }

    public SecurityBoxException(String message) {
        this.resultData = new ResultData(ResultDataEnum.FAIL.code(), message, null);
    }
    public SecurityBoxException(ResultData resultData) {
        this.resultData = resultData;
    }
}
